package com.aSemy.qotwReader.core.parseInput.exceptions;

import java.io.File;

/**
 * If an argument for a command is a directory, then it must be validated.
 * This exception should be thrown when the directory fails validation.
 * @author Adam Semenenko
 */
public class NotDirectoryException extends Exception
{
    /** Eclipse made me do this I don't know what it does but it stops Eclipse from complaining. */
    private static final long serialVersionUID = 9212642369866525741L;

    /**
     * The file given is supposed to be a directory, but it is not.
     * @param file The file which is not a directory.
     * @param expectedDir A description of the directory that was expected, e.g. "the directory where Calibre is installed".
     */
    public NotDirectoryException(File file, String expectedDir)
    {
        super(
                "The argument given\n" +
                "(" + file.getAbsolutePath() + ")\n" +
                "was not a directory.\n" +
                "What was expected was " + expectedDir
             );
    }
}
